<template>
    <div class="box">{{type}}</div>
</template>

<script setup lang="ts">
const props = defineProps(["type"]);
const typeToColorMap = {
    [0]: "gray",
    [1]: "red",
};
const color = typeToColorMap[props.type];
</script>

<style scoped>
.box {
    width: 20px;
    height: 20px;
    background: v-bind(color);
    margin: 2px;
}
</style>
